<section class="header clearfix">
  <div class="pull-left">
    <h1>
      {{#if editing}}
        {{t "podSecurityPoliciesPage.editPodSecurityPolicy"}}
      {{else if readOnly}}
        {{t "podSecurityPoliciesPage.detail.header"}}: {{model.name}}
      {{else}}
        {{t "podSecurityPoliciesPage.addPodSecurityPolicy"}}
      {{/if}}
    </h1>
  </div>
</section>

{{#if (and readOnly model.description)}}
  <div class="row mb-30">
    {{banner-message
      color="bg-secondary mb-0 mt-10"
      message=(linkify model.description)
    }}
  </div>
{{/if}}

{{#unless readOnly}}
  <section class="horizontal-form container-fluid">
    {{form-name-description
      model=model
      nameRequired=false
      namePlaceholder="podSecurityPoliciesPage.new.form.name.placeholder"
    }}
  </section>
{{/unless}}

<section>
  {{#accordion-list as |al expandFn|}}
    <div class="mt-20">
      {{form-basic-policy
        model=model
        expandAll=al.expandAll
        expandFn=expandFn
        readOnly=readOnly
      }}
    </div>

    <div class="mt-20">
      {{form-capability-policy
        model=model
        expandAll=al.expandAll
        expandFn=expandFn
        readOnly=readOnly
      }}
    </div>

    <div class="mt-20">
      {{form-volume-policy
        model=model
        expandAll=al.expandAll
        expandFn=expandFn
        readOnly=readOnly
      }}
    </div>

    <div class="mt-20">
      {{form-hostpath-policy
        model=model
        expandAll=al.expandAll
        expandFn=expandFn
        readOnly=readOnly
      }}
    </div>

    <div class="mt-20">
      {{form-fsgroup-policy
        model=model
        expandAll=al.expandAll
        expandFn=expandFn
        readOnly=readOnly
      }}
    </div>

    <div class="mt-20">
      {{form-hostports-policy
        model=model
        expandAll=al.expandAll
        expandFn=expandFn
        readOnly=readOnly
      }}
    </div>

    <div class="mt-20">
      {{form-runasuser-policy
        model=model
        expandAll=al.expandAll
        expandFn=expandFn
        readOnly=readOnly
      }}
    </div>

    <div class="mt-20">
      {{form-runasgroup-policy
        model=model
        expandAll=al.expandAll
        expandFn=expandFn
        readOnly=readOnly
      }}
    </div>

    <div class="mt-20">
      {{form-selinux-policy
        model=model
        expandAll=al.expandAll
        expandFn=expandFn
        readOnly=readOnly
      }}
    </div>

    <div class="mt-20">
      {{form-supplementalgroups-policy
        model=model
        expandAll=al.expandAll
        expandFn=expandFn
        readOnly=readOnly
      }}
    </div>

    <div class="mt-20">
      {{form-labels-annotations
        labelErrors=labelErrors
        initialLabels=model.labels
        setLabels=(action "setLabels")
        expandAll=al.expandAll
        expandFn=expandFn
        model=model
        editing=editing
      }}
    </div>

  {{/accordion-list}}
</section>


{{top-errors errors=errors}}

{{#unless readOnly}}
  {{save-cancel
    editing=editing
    save=(action "save")
    cancel=(action "cancel")
  }}
{{/unless}}
